﻿@model List<Video>
@{ ViewBag.Title = "Manage Videos"; }
<p>Below are the list of videos available for download on the site.</p>
<p>@Html.ActionLink("Add New Video", "New")</p>
<table>
    <tr>
        <th>
            Title
        </th>
        <th>
            Teaser
        </th>
        <th>
            Price
        </th>
        <th>
            Active
        </th>
        <th>
            Date Modified
        </th>
        <th style="width:130px;"></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td class="markup">
            @Html.Raw(item.Teaser)
        </td>
        <td>
            @item.PriceString()
        </td>
        <td>
            @(item.Active ? "Yes" : "No")
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DatePosted)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.Id }, new { onclick = "return confirm('Are you sure you want to delete this video?')" })
        </td>
    </tr>
}
</table>